How To: use Nintex Mobile signature in Document Generation
Table of contents:
I recently was asked a question: how can I use the signature from the Nintex Mobile inside a document being generated by the Generate Document action? Unfortunately this is not yet feasible only using Nintex products. This is because Nintex Workflow for Office 365 is not handling correctly the binary data (it loses null bits) so what I proposed was to use Microsoft Flow.
The process
- User sings a form in Nintex Mobile.
- The signature along with the form is saved in a SharePoint list.
- Then the Nintex workflow on item’s creation is triggered.
- It builds a JSON, that is a request body, then calls Microsoft Flow, passing:
- form’s title and
- base64 encoded signature from a multi-line text field.
- Flow receives the call, starts and uploads signature to the images library, converting it from base64 to binary.
- In resposne Flow sends the URL to the created file.
- Nintex receives the response and attempts to generate a document, having an image defined, that is the signature, having a variable set as a path (that is returned by Flow).
- Finally it generates a PDF with the signature inside.
Implementation
Microsoft Flow
Its purpose is simple – get base64 encoded string and convert it into binary, then upload to a specified document’s library. It is being invoked by a “Web Request” message, that should contain a valid JSON string, containing title of a form (it is using it to set file’s name) and base64 encoded string.
{ "Title": "Form's title or other text variable", "Signature": "The base64 encoded signature image" }
After that it immediately calls SharePoint (using “Create File” action) and uploads the file, using the expression “Base64ToBinary”:
base64ToString(triggerBody()?['Signature'])
After that it send back in “Response” action the uploaded file path:
Nintex Workflow
Is being triggered once a new item is created – user sends the signed form. Workflow purpose is to build a JSON that is a request body, and that is in a correct format – the one that Microsoft Flow workflow is expecting.
Then it calls the Flow, using the “Web Request” action:
And stores the “Response Content” in a text variable.
Then it builds an absolute path to the uploaded signature image, by joining workflow context’s current site URL with the text received after Web Request call – the site relative path of the uploaded file.
Next it generates the document.using the Document Generation action.
The results
The working proof of concept:
You can find attached exported Nintex Workflow and Flow files.
[wpdm_package id=’1019′]
[wpdm_package id=’1018′]
Aarudhra
HI Tomasz,
Great Article, whether the same approach can be used in sharepoint instead of Nintex. If Yes can you please provide a new blog with sharepoint. This would be great Stuff.
Tomasz Poszytek
Hi, this functionality is built using Nintex and I cannot recall anything similar using OOTB SharePoint. I mean – collecting a handwriting signature via the mobile app. Or is it and I am missing something?